# Table of Contents

1.  [Algorithm](#org326e38f)
2.  [To do ](#org6a690a2)



<a id="org326e38f"></a>

# Algorithm

The following is a description of the decryption algorithm by A-Man:

> 1-Open the file for reading and store what's inside into a variable (or stream it, whatever you prefer/have available). The content of the file is gibberish (because it's encrypted).
>
> 2-Skip over the first one hundred and twenty three characters and start going through all characters in the file. Since counting in computers starts from 0, this means you will start from the 124rd letter character (index 123).
>
> 3-For every character you go through, convert it to its ASCII code, subtract from it the ASCII code of the Nth character in the key "odBearBecauseHeIsVeryGoodSiuHungIsAGo" (yes, the letters are shifted because there is a caeser cipher step we can skip with using this shifted key).
>
> 4- N is an index in the key which keeps increasing for every character and restarts back to 0 when it reaches the end of the key.
>
> &#x2013; <https://lf-empire.de/forum/showthread.php?pid=198669#pid198669>


<a id="org6a690a2"></a>

# To do

-   [ ] manage to parse the whole `stage.dat`
-   [ ] write tests for things in the grammar
-   [ ] create useful accessor functions for parts of the parse tree of `stage.dat`
-   [ ] create procedures for writing data files
